Skip to main content

Full text of "Hacks and Mods"

See other formats


Using a Kinectas an Infrared Camera 



.1 



Make Projects 



build, hack, tweak, share, discover- 



Using a Kinect as an Infrared 



Camera 



Written By: Damon Conover 



TOOLS: 



Calipers (1) 

Drill, or drill press, with drill bits (1) 

Multimeter, with Continuity Tester (1) 

Pliers (1) 

Scissors (1) 

Soldering iron, with solder (1) 

Wire cutter/stripper (1) 



PARTS: 



Computer (1) 

Microsoft Kinect for Xbox 360, with 
power supply cable (1) 

Duct taped) 

Velcrod) 

Infrared LED, 850 nm (24) 
SparkFun part # COM-09469 

resistors, 360 Ohm (4) 

Wire, 22 gauge solid-core (1) 

2,4" (diameter) round printed-circuit 
board (PCB) (2) 
RadioShack part # 276-004 

Plastic Cup (2) 

Small project box, 3"x2"x1"(1) 
RadioShack part # 270- 1801 

screw-cap panel-mount fuse holder (1) 
RadioShack part # 270-364 

Fuse, 0,25 A, 1-1/4x1/4" (1) 



© Make Projects 



www.makeprojects.com 



Page 1 of 14 



Using a Kinectas an Infrared Camera 



2.5 mm DC power jack (1) 
Jameco part #101186 

Potentiometer (POT). 500 Ohm (2) 
Jameco part # 264373 

SPDT Switch (1) 
Jameco part #21936 

12 VDC wall-adapter power supply (1) 
Jameco part # 105478 

Electrical Tape (1) 

Sugru hacking putty (1) 

Small tripod (optional) (1) 
RadioShack part # TG-GP3010 

Rocketfish Universal Kinect Mount 

(optional) (1) 

Best Buy part # 1974833 

ring stand, with various clamps, rods, 
and hinges (optional) (1) 

8-1/2x11 in. piece of construction paper 

in 

charcoal pencil (1) 

• soft pastel, phthalo blue (570.5) (1) 
plazaart.com item # 346471 

soft pastel. Prussian blue (508,7) (1) 
plazaart.com item # 346437 



SUMMARY 

The Kinect is a peripheral for the Xbox 360 console that allows a user to interact with the 
Xbox 360 without touching a controller. A general description of the Kinect is that it is a 
depth camera. This means that you can place objects in front of it, and it will compute the 
distance from it to the objects, thus creating a depth image. Therefore, the Kinect can 
provide the locations of objects in an image relative to itself, and this information can be 
used in a variety of projects. Also, the Kinect contains many components that, with slight 
modifications, can be used for new purposes. As an example, this project will show how the 
Kinect can be used as an infrared (IR) camera. 

© Make Projects www.makeprojects.com 



Page 2 of 14 



Using a Kinectas an Infrared Camera 

For a detailed description of how the Kinect works and how it can be used in different 
projects, I recommend that you read Making Things See by Greg Borenstein 
( http://shop.oreilly.com/product/06369200. .. ). The image in Step 1 shows the components of 
the Kinect that are necessary to understand this project. The IR projector shines a grid of IR 
dots on the objects in front of it. We are not able to see the dots, but the IR camera can 
detect them. Using the pattern of dots on each object, the Kinect is able to compute the 
depth image. The final component is an RGB camera that is similar to a standard webcam. 



Step 1 — Install the software necessary to connect the Kinect to your 
computer 



Follow the platform-specific 
instructions here to: 

• Install Processing 

• Install OpenNI, NITE, Sensor, 
and SensorKinect drivers 

• Install SimpleOpenNI library for 
Processing 




© Make Projects 



www.makeprojects.com 



Page 3 of 14 



Using a Kinectas an Infrared Camera 



Step 2 — Verify that the installation was successful 




Start Processing and run the 
Depthlmage and Depth Infrared 
examples. 

• Provide power to your Kinect 
and connect it to your computer 
via the USB port. 

• Goto 
File->Examples->Contributed 
Libraries^SimpleOpenNI— >OpenNI. 

• Double-click on the example that 
you wish to run (for example, 
Depthlnfrared), and the example 
script will open. 

• Click on the run button, and an 
image will appear on your 
screen. For the Depthlnfrared 
script, a depth image will be on 
the left and an IR image will be 
on the right, as shown on the 
left. 



© Make Projects 



www.makeprojects.com 



Page 4 of 14 



Using a Kinectas an Infrared Camera 



Step 3 — Block the IR projector 




As can be seen in the previous 
step, the IR image produced by the 
Depthlnfrared script contains a 
pattern of dots that we wish to 
remove. 

To do this, create a blindfold to 
cover the IR projector. 

• Take two strips of duct tape, 
each longer than 9 inches, and 
place one such that it slightly 
overlaps the other. Then repeat 
using two more strips of duct 
tape. 

• Take the two strips of double- 
wide duct tape and place them 
sticky sides together. 

• Cut the resulting strip to 9 
inches in length. 

• Place Velco pads on one end of 
the strip, wrap the strip around 
the Kinect, covering the IR 
projector, and place the opposite 
Velco pads such that the strip is 
held tight, as shown on the left. 



© Make Projects 



www.makeprojects.com 



Page 5 of 14 



Using a Kinectas an Infrared Camera 



Step 4 — Build the IR lamps 



II* T I -O 



. _ *£? . _ ^C? .1 



U * !! 



! I jc 1 E .» 



BOMIJUCMM 



Q^S 



-*^° *^_ 




IR 
lamp 1 



r 

SYVSOO 



!! jp ^ -e 



lamp intensity 
controller 



IR 
lamp 2 






!: jo !£ 



Now that the IR projector has been 
blocked, there is no longer enough 
IR light for the IR camera to 
generate a good image. 

Therefore, external IR lighting 
needs to be added. The circuit 
diagram on the left shows one 
possible design for two IR lamps. 

• Connect the DC power supply to 
the power jack and measure its 
voltage (VDC) using a 
multimeter. For my power 
supply, VDC = 15.6 V. 

• Look up the typical forward 
voltage (VF) and maximum 
forward current (IF, max) of the 
LEDs. Mine were VF = 1 .5 V and 
IF = 20 mA, respectively. 

• Compute the resistance 
(R1=R2=R3=R4) necessary to 
limit the current through each 
series of six LEDs. I used 360 Q 
resistors. R > ((VDC - (# of 
LEDs)*VF)/IF) 



© Make Projects 



www.makeprojects.com 



Page 6 of 14 



Using a Kinectas an Infrared Camera 



Step 5 — Build the IR lamps (continued) 









anode 



D1 

LED 



^ 



• 



cathode 



• On one half of a PCB, place six LEDs and one resistor. Solder wires connecting the 
LEDs, cathode to anode, and the resistor. Repeat for the other half of the PCB. Then 
solder a wire connecting the free anodes and another wire connecting the free end of the 
resistors. 

• Solder a long, red wire to the connected anodes and a long, black wire to the connected 
resistors. 

• (optional) Use Sugru to hold the long wires to the PCB in order to provide some strain 
relief. 

• Poke holes in the bottom of a plastic cup, feed the wires through the hole, and press the 
PCB tightly into the cup. If the PCB does not fit tightly, use Sugru to hold it in place. 

• Repeat the previous four steps for the second lamp. 



© Make Projects 



www.makeprojects.com 



Page 7 of 14 



Using a Kinectas an Infrared Camera 



Step 6 — Build the lamp intensity controller 




Use calipers to measure the sizes 
of the holes necessary to mount 
the two pots, switch, fuse holder, 
and power jack. 

Drill holes in the project enclosure 
and mount the hardware. Also, drill 
two small holes for the wires to 
enter. When planning on where to 
place each hole, keep in mind 
where each part will sit in the 
enclosure, in order to make sure 
that everything fits. 

• You will need to open the hole 
for the power jack using a 
Dremel tool or with a knife. 

• Place Sugru on the inside and 
outside of the enclosure to hold 
the jack in place. 



© Make Projects 



www.makeprojects.com 



Page 8 of 14 



Using a Kinectas an Infrared Camera 



Step 7 — Build the lamp intensity controller (continued) 




Turn each pot to the position that 
will be the low setting and then 
use your multimeter's continuity 
tester to find the two pins that 
will be used in the circuit (the 
tester will beep). 

Also, use the continuity tester to 
determine which two pins on the 
switch are connected when the 
switch is up and which are 
connected when the switch is 
down. 

Solder short wires connecting 
the parts within the enclosure, 
according to the circuit diagram. 

Solder two long, red wires to the 
pots and two long, black wires to 
the switch, and then poke them 
through the two small holes. 

Screw on the enclosure's lid and 
place a fuse in the fuse holder. 

Twist the wires exiting the lamps 
together with the wires entering 
the controller (red-to-red, black- 
to-black), solder if necessary, 
then cover the exposed wires 
with electrical tape. 



© Make Projects 



www.makeprojects.com 



Page 9 of 14 



Using a Kinectas an Infrared Camera 



Step 8 — Mount the Kinect and lamps 




• Place the Kinect on a surface, 
pointed at the object that you wish 
to image. 

• (optional) Connect the Kinect to 
the tripod connector and then to 
a tripod. Connect the tripod to a 
ring stand, and position it in front 
of the imaging surface. 

• Mount the lamps in an orientation 
such that the imaging surface will 
be illuminated. 

• (optional) Connect the lamps to 
the ring stand and hold them in 
position with the clamps, hinges, 
and tape. 

• Plug the wall-adapter power supply 
into an outlet and then connect it to 
the lamp intensity controller via the 
power jack. 



© Make Projects 



www.makeprojects.com 



Page 10 of 14 



Using a Kinectas an Infrared Camera 



Step 9 — Perform the experiment 





• Take a piece of construction paper and draw one object on the left side and another on the 
right side, using a charcoal pencil. 

• Color over the left object with the phthalo blue pastel and color over the right object with 
the Prussian blue pastel. 

• Place the paper in front of the camera. 

• Open Processing, create scripts rgb_save.pde and ir_save.pde (code is provided in 
the attached code.pdf), modify the code such that the files and path names are appropriate 
for your computer, run rgb_save.pde, and then run ir_save.pde. 

• Turn on the lamps by flipping the switch, and then adjust the intensity using the knobs on 
the controller. You will not be able to see the IR light emitted by the LEDs, so use the IR 
video captured by the camera to determine the desired intensity. You will need to run the 
two scripts again, after adjusting the lamps. 

• The resulting image, shown on the left, should show a color image at the top and an IR 
video at the bottom. The results show that the two pigments look similar in the color 
portion of the spectrum, but very different in the IR portion. 

• For a detailed description of the science behind this experiment, I recommend that you 
read the papers by Delaney et al. listed in the references. 



© Make Projects 



www.makeprojects.com 



Page 11 of 14 



Using a Kinectas an Infrared Camera 



Step 10 — References 



© Make Projects www.makeprojects.com Page 12 of 14 



Using a Kinectas an Infrared Camera 



Fiber Optics Relectance Spectra <FORS) of Blue Pigments 



■ prvimnWu* 



frftZ* i. 



s a 



■Ji,n'-!ri : JlfeiVnjl 



1 I 



Simple-openni Wiki (last accessed 
20 April 2012). *** The examples 
included with the toolbox are 
particularly helpful. 

Borenstein, Greg, Making Things 
See, O'Reilly Media, Inc., 978-1- 
449-30707-3, January 2012. 

Reas, Casey and Ben Fry, Getting 
Started with Processing, O'Reilly 
Media, Inc., 978-1-449-37980-3, 
June 2010. 

Blake, Joshua, "Kinect Hacking", 
Make:, Volume 29, 124-133, 
http://makeprojects.eom/Wiki/29#Section 
(last accessed 20 April 2012). 

Delaney, John K., Elizabeth 
Walmsley, Barbara H. Berrie, and 
Colin F. Fletcher, "Multispectral 
Imaging of Paintings in the Infrared 
to Detect and Map Blue Pigments", 
(Sackler NAS Colloquium) 
Scientific Examination of Art: 
Modern Techniques in 
Conservation and Analysis, 
Proceedings of the National 
Academy of Sciences, 120-136, 
http://www.nap.edu/catalog/11413.html 
(last accessed 20 April 2012), 0- 
309-54961-2, 2005. 

Delaney, John K., Jason G. Zeibel, 
Mathieu Thoury, Roy Littleton, 
Kathryn M. Morales, Michael 
Palmer, E. Rene de la Rie, "Visible 
and Infrared Reflectance Imaging 
Spectroscopy of Paintings: 
Pigment Mapping and Improved 
Infrared Reflectography", Q3A: 



© Make Projects 



www.makeprojects.com 



Page 13 of 14 



Using a Kinectas an Infrared Camera 



Optics for Arts, Architecture, and 
Archaeology II, edited by Luca 
Pezzati and Renzo Salimbeni, 
Proc. of SPIE Vol. 7391, 2009. 



Step 11 — Acknowledgments 






The author wishes to thank Dr. 
Murray Loew, of George 
Washington University, and Dr. 
John Delaney and Dr. E. Melanie 
Gifford, of the National Gallery of 
Art, Washington, D.C., for their 
feedback regarding the 
experimental setup. 

The author also wishes to 
acknowledge the scholarship 
support that he received from the 
Achievement Rewards for College 
Scientists (ARCS) Foundation. 



NOTE: Once you have successfully installed the software for connecting the Kinect to your 
computer, the only required steps for completing this project are: 1) block the IR projector, 2) 
build and mount a replacement IR light source (with a center wavelength near 830 nm), and 3) 
experiment. The details of my apparatus and experiment are provided, but I encourage you to 
modify the details based on the parts and equipment that you have available and based on the 
things that you wish to image. Happy building! 

This document was last generated on 2012-11-01 11:50:21 AM. 



© Make Projects 



www.makeprojects.com 



Page 14 of 14